package org.example.myleet.p1418;

import org.example.myleet.Utils.Assert;
import org.example.myleet.Utils.JsonUtils;

import java.util.List;

public class Main {
    public static void main(String[] args) {
        Solution solution = new Solution();
        Assert.isTrue(Assert.isPass(
                parse("[[\"Table\",\"Beef Burrito\",\"Ceviche\",\"Fried Chicken\",\"Water\"],[\"3\",\"0\",\"2\",\"1\",\"0\"],[\"5\",\"0\",\"1\",\"0\",\"1\"],[\"10\",\"1\",\"0\",\"0\",\"0\"]]"),
                solution.displayTable(parse("[[\"David\",\"3\",\"Ceviche\"],[\"Corina\",\"10\",\"Beef Burrito\"],[\"David\",\"3\",\"Fried Chicken\"],[\"Carla\",\"5\",\"Water\"],[\"Carla\",\"5\",\"Ceviche\"],[\"Rous\",\"3\",\"Ceviche\"]]"))));
        Assert.isTrue(Assert.isPass(
                parse("[[\"Table\",\"Canadian Waffles\",\"Fried Chicken\"],[\"1\",\"2\",\"0\"],[\"12\",\"0\",\"3\"]]"),
                solution.displayTable(parse("[[\"James\",\"12\",\"Fried Chicken\"],[\"Ratesh\",\"12\",\"Fried Chicken\"],[\"Amadeus\",\"12\",\"Fried Chicken\"],[\"Adam\",\"1\",\"Canadian Waffles\"],[\"Brianna\",\"1\",\"Canadian Waffles\"]]"))));
        Assert.isTrue(Assert.isPass(
                parse("[[\"Table\",\"Bean Burrito\",\"Beef Burrito\",\"Soda\"],[\"2\",\"1\",\"1\",\"1\"]]"),
                solution.displayTable(parse("[[\"Laura\",\"2\",\"Bean Burrito\"],[\"Jhon\",\"2\",\"Beef Burrito\"],[\"Melissa\",\"2\",\"Soda\"]]"))));
    }

    private static List<List<String>> parse(String input) {
        return JsonUtils.parse(input, List.class);
    }
}
